<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8"/>
	<title></title>
	<script src="vue.js" type="text/javascript"></script>
</head>
<body>
	<div id="app">
		<input type="text" v-model="message" @keyup.enter="getElement">
		<input type="button" name="" id="" value="改变message" @click="setM" />
		<h2>{{ message }}</h2>
	</div>
<script>
	var app=new Vue({
		el:"#app",
		data:{
			message:"这是一个文本框！"
		},
		methods: {
			getElement:function() {
				alert(this.message)
			},
			setM:function(){
				this.message="我变化了哦！"
			}
		},
	})
</script>

</body>
</html>
